#include <iostream>
#include <cstring>

// 定义一个结构体
struct Student {
    char name[50];
    int age;
    float gpa;
};

int main() {
    // 初始化一个结构体
    Student student1;

    // 访问结构体内的元素
    strcpy(student1.name, "John Doe");
    student1.age = 20;
    student1.gpa = 3.5;

    // 使用结构体
    std::cout << "Student Name: " << student1.name << std::endl;
    std::cout << "Student Age: " << student1.age << std::endl;
    std::cout << "Student GPA: " << student1.gpa << std::endl;

    // 初始化一个结构体
    Student student2 = {"Jane Doe", 21, 3.7};

    // 使用结构体
    std::cout << "Student Name: " << student2.name << std::endl;
    std::cout << "Student Age: " << student2.age << std::endl;
    std::cout << "Student GPA: " << student2.gpa << std::endl;

    return 0;
}